/* 
 * File:   Shader.h
 * Author: brady
 *
 * Created on February 8, 2011, 10:51 AM
 */


#include "Ray.h"
#include "Texture.h"
#include "Scene.h"
using namespace cs5721;

#ifndef SHADER_H
#define	SHADER_H



class Shader {
public:
    Shader();
    Shader(const Shader& orig);
    virtual ~Shader();
    virtual Vector3D Shade(Ray &viewingRay, HitStruct& hitStruct, Scene* scene) = 0;
    void SetColor(Vector3D color){Color = color;}
    void SetTexture(Texture* texture){this->texture = texture;}
    Vector3D GetColor(){return Color;}
    void SetRecursionDepth(int rd){rd = recursionDepth;}
protected:
    Vector3D Color;
    Texture* texture;
    int recursionDepth;
    double Magnitude(Vector3D v);
    Vector3D Mix(Vector3D c1, Vector3D c2); //multiplies each channel of the 2 vectors together
    Vector3D& Cap(Vector3D& color, double value); //cap the vector values at the given value

};

#endif	/* SHADER_H */

